import type { FormSchema, FormSetProps, useForm } from '../Form'
import { withInstall } from '../../helpers/installer'
import Search from './src/Search.vue'

export type { SearchProps } from './src/types'

export interface SearchExpose {
  setValues: (data: Record<string, any>) => void
  setProps: (props: Record<string, any>) => void
  delSchema: (field: string) => void
  addSchema: (formSchema: FormSchema, index?: number) => void
  setSchema: (schemaProps: FormSetProps[]) => void
  formModel: Record<string, any>
  formMethods: ReturnType<typeof useForm>['formMethods']
  search: () => Promise<void>
  reset: () => Promise<void>
}

const SearchInstaller = withInstall(Search)
export { Search, SearchInstaller }
